$(document).ready(function() {
  var $table = $('#worker-table');
  $table.bootstrapTable({
    data: data,
    pagination: true,
    pageSize: 10
  });
});

var data = [
  {
    field0: '001009',
    field1: 'G220公路工程',
    field2: '2016.12.10',
    field3: '是',
    field4: '20,000',
    field5: '王涛'
  },
  {
    field0: '001009',
    field1: 'G220公路工程',
    field2: '2016.12.10',
    field3: '是',
    field4: '20,000',
    field5: '王涛'
  },
  {
    field0: '001009',
    field1: 'G220公路工程',
    field2: '2016.12.10',
    field3: '是',
    field4: '20,000',
    field5: '王涛'
  },
  {
    field0: '001009',
    field1: 'G220公路工程',
    field2: '2016.12.10',
    field3: '是',
    field4: '20,000',
    field5: '王涛'
  }
];

function getCheckBox(id, row) {
  var html = '<input type="checkbox" name="checkbox" sid="' + id + '">';
  return html;
}

//用户，全选/全不选
function selectAll(ele) {
  var bool = $(ele).is(':checked');
  $('input[name="checkbox"]').prop("checked", bool);
};

function clickOperate(id, row) {
  // var roleIds = row.roleIds;
  // 传值给click事件
  return "<a class='qn-check J_menuItem' href='bidInfoDetail.html'>详情</a>" +
         "<a class='qn-check J_menuItem' href='addContractInfo.html'>转合同</a>";
}

// +
//          "<a class='qn-check J_menuItem' href='contractInfoDetail.html'>查看合同</a>

// 删除
function deleteBid() {
  var ids = $.map($('input[name="checkbox"]'), function (item) {
    if ($(item).is(':checked')) {
      return $(item).attr("sid");
    }
  });
  if(ids.length == 0){
    showAlert(null,"请选择数据后再删除");
    return;
  }
  showConfirm("提示","是否确定删除？",function() {
    
  });
}